// 2025/8/11
// 小红的口罩

#include <iostream>
#include <queue>
using namespace std;

int main() {
    int n, k, tmp;
    cin >> n >> k;
    priority_queue<int, vector<int>, greater<int>> heap;
    while(n--)
    {
        cin >> tmp;
        heap.emplace(tmp);
    }

    int ans = 0, cur = heap.top();
    while(cur <= k)
    {
        ans++;
        tmp = heap.top();
        heap.pop();
        heap.emplace(tmp * 2);
        cur += heap.top();
    }
    cout << ans << endl;
}
// 64 位输出请用 printf("%lld")